package com.ruoyi.system.api;

import java.util.List;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysDept;
import com.ruoyi.system.api.factory.RemoteSysDeptFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;


/**
 * 部门微服务接口
 * 
 * @author ruoyi
 * @date 2023-04-27
 */
@FeignClient(contextId = "remoteSysDeptService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSysDeptFallbackFactory.class)
public interface RemoteSysDeptService
{
    /**
     * 查询部门
     * 
     * @param deptId 部门主键
     * @return 部门
     */
    @GetMapping("/inner/dept/{deptId}")
    public R<SysDept> selectSysDeptByDeptId(@PathVariable("deptId") Long deptId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询部门列表
     * 
     * @param sysDept 部门
     * @return 部门集合
     */
    @PostMapping("/inner/dept/list")
    public R<List<SysDept>> selectSysDeptList(SysDept sysDept, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 新增部门
     * 
     * @param sysDept 部门
     * @return 结果
     */
    @PostMapping("/inner/dept")
    public R<Integer> insertSysDept(@RequestBody SysDept sysDept, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 修改部门
     * 
     * @param sysDept 部门
     * @return 结果
     */
    @PutMapping("/inner/dept")
    public R<Integer> updateSysDept(@RequestBody SysDept sysDept, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 批量删除部门
     * 
     * @param deptIds 需要删除的部门主键集合
     * @return 结果
     */
    @DeleteMapping("/inner/dept/{deptIds}")
    public R<Integer> deleteSysDeptByDeptIds(@PathVariable("deptIds") Long[] deptIds, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
